package com.google.code.zeroclipboard;

import org.apache.tapestry5.ioc.services.SymbolSource;

public class ZeroclipboardConstants {

	public static final String VERSION_KEY = "com.google.code.zeroclipboard.version";

	public static final String BASEDIR_KEY = "com.google.code.zeroclipboard.basedir";

	public static final String VERSION_DEFAULT = "1.0.7";

	public static final String BASEDIR_DEFAULT = "classpath:/com/google/code/zeroclipboard/v";

	public static String getDir(final String baseDir, final String version) {
		final StringBuilder sb = new StringBuilder(baseDir);
		sb.append(version.replaceAll("\\.", "_"));
		sb.append('/');
		return sb.toString();
	}

	public static String getAssetDir(final SymbolSource symbols, final String asset) {
		final StringBuilder sb = new StringBuilder(getDir(symbols.valueForSymbol(BASEDIR_KEY), symbols.valueForSymbol(VERSION_KEY)));
		sb.append(asset);
		return sb.toString();
	}

}
